function foo() {};
function foo(a: number) {};
function foo(a = 1) {};
function foo(a?: number) {};
function foo(a: number, b: number) {};
function foo(a: number, b: number, c?: number) {};
function foo(a: number, b = 1) {};
function foo(a: number, b = 1, c = 1) {};
function foo(a: number, b = 1, c?: number) {};
function foo(a: number, b?: number, c = 1) {};
function foo(a: number, b = 1, ...c) {};

const foo = function () {};
const foo = function (a: number) {};
const foo = function (a = 1) {};
const foo = function (a?: number) {};
const foo = function (a: number, b: number) {};
const foo = function (a: number, b: number, c?: number) {};
const foo = function (a: number, b = 1) {};
const foo = function (a: number, b = 1, c = 1) {};
const foo = function (a: number, b = 1, c?: number) {};
const foo = function (a: number, b?: number, c = 1) {};
const foo = function (a: number, b = 1, ...c) {};

const foo = () => {};
const foo = (a: number) => {};
const foo = (a = 1) => {};
const foo = (a?: number) => {};
const foo = (a: number, b: number) => {};
const foo = (a: number, b: number, c?: number) => {};
const foo = (a: number, b = 1) => {};
const foo = (a: number, b = 1, c = 1) => {};
const foo = (a: number, b = 1, c?: number) => {};
const foo = (a: number, b?: number, c = 1) => {};
const foo = (a: number, b = 1, ...c) => {};

class Foo {
  constructor(a: number, b: number, c: number) {}
};

class Foo {
  constructor(a: number, b?: number, c = 1) {}
};

class Foo {
  constructor(a: number, b = 1, c?: number) {}
};

class Foo {
  constructor(
    public a: number,
    protected b: number,
    private c: number,
  ) {}
};

class Foo {
  constructor(
    public a: number,
    protected b?: number,
    private c = 10,
  ) {}
};

class Foo {
  constructor(
    public a: number,
    protected b = 10,
    private c?: number,
  ) {}
};

class Foo {
  constructor(
    a: number,
    protected b?: number,
    private c = 0,
  ) {}
};

class Foo {
  constructor(
    a: number,
    b?: number,
    private c = 0,
  ) {}
};

class Foo {
  constructor(
    a: number,
    private b?: number,
    c = 0,
  ) {}
}

const defaultValue = 0;
export function f1(a = defaultValue) {
  return a;
}
export function f2(a: number, b = defaultValue) {
  return a + b;
}
export function f3(a: number, b?: number) {
  return b !== undefined ? a + b : a;
}
export function f4(a: number, b?: number, c = defaultValue) {
  return b !== undefined ? a + b + c : a + c;
}
export function f5(a: number, b = defaultValue, c?: number) {
  return c !== undefined ? a + c : a + b;
}